if(typeof getCookie === 'undefined'){ function getCookie(name) { var cookieVal = document.cookie.split(";"); var tempCookie; for(var i in cookieVal) { tempCookie = cookieVal[i].trim().split("="); if (tempCookie[0] == name) { return tempCookie[1]; } } return null; } } if(typeof setCookie === 'undefined'){ function setCookie(c_name,value,exdays) { var domain=document.domain; domain=domain.replace('www.',''); domain=domain.replace('m.meritnation','meritnation'); var exdate=new Date(); exdate.setDate(exdate.getDate() + exdays); var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString()) + ";domain=."+domain + ";path=/"; document.cookie=c_name + "=" + c_value; } } if(typeof webengage === 'undefined' && getCookie("CakeCookie[isLogin]")){ var webengage; !function(w,e,b,n,g){function o(e,t){e[t[t.length-1]]=function(){r.__queue.push([t.join("."),arguments])}}var i,s,r=w[b],z=" ",l="init options track screen onReady".split(z),a="feedback survey notification".split(z),c="options render clear abort".split(z),p="Open Close Submit Complete View Click".split(z),u="identify login logout setAttribute".split(z);if(!r||!r.__v){for(w[b]=r={__queue:[],__v:"6.0",user:{}},i=0;i=0 || wholeUrlArr.indexOf('test-reports') >=0 || wholeUrlArr.indexOf('testReport') >=0) && typeof mnInstruction != 'undefined'){ if(mnInstruction.courseId != undefined || mnInstruction.courseId != 'undefined'){ data['courseid'] = mnInstruction.courseId; } if(mnInstruction.testSubjectId != undefined || mnInstruction.testSubjectId != 'undefined'){ data['sid'] = mnInstruction.testSubjectId; } if(mnInstruction.testTextbookId != undefined || mnInstruction.testTextbookId != 'undefined'){ data['tid'] = mnInstruction.testTextbookId; } if(mnInstruction.testChapterId != undefined || mnInstruction.testChapterId != 'undefined'){ data['chid'] = mnInstruction.testChapterId; } } else if(wholeUrlArr.indexOf('ask-answer') >=0){ if(AnaJsGlobalVars != undefined && AnaJsGlobalVars != 'undefined'){ if(AnaJsGlobalVars.selectedIds != undefined && AnaJsGlobalVars.selectedIds != 'undefined'){ var selectedIds = AnaJsGlobalVars.selectedIds.split('-'); if(selectedIds[2] != undefined){ data['sid'] = selectedIds[2]; } if(selectedIds[3] != undefined){ data['chid'] = selectedIds[3]; } }else{ if(AnaJsGlobalVars.subjectId != undefined){ data['sid'] = AnaJsGlobalVars.subjectId; } if(AnaJsGlobalVars.chapterId != undefined){ data['chid'] = AnaJsGlobalVars.chapterId; } } } }else{ var cstchStr = wholeUrlArr[wholeUrlArr.length-1]; var cstchArr = cstchStr.split('_'); if(cstchArr[1] != undefined){ data['courseid'] = cstchArr[0]; data['sid'] = cstchArr[1]; } if(cstchArr[2] != undefined){ data['tid'] = cstchArr[2]; } if(cstchArr[3] != undefined){ data['chid'] = cstchArr[3]; } } if(typeof(Storage) !== "undefined"&&typeof sessionStorage.refererTimeSpent != "undefined" && typeof getCookie('mnVirtualSession') != 'undefined'){ data.refererTimeSpent = Math.round(new Date().getTime()/1000) - parseInt(sessionStorage.refererTimeSpent); } $.ajax({ type: "POST", data:data, url: url, success: function(response){ try{ if(response=='mnsess'){ } }catch(err){ } if(typeof(Storage) !== "undefined") { sessionStorage.refererTimeSpent = Math.round(new Date().getTime()/1000); } } }); //Remove LocalStorage Cached Data for Logout User var checkLocalStorage = isBrowserSupportLocalStorage(); if(typeof checkLocalStorage!= 'undefined' && checkLocalStorage==true && document.cookie.indexOf("CakeCookie[isLogin]")==-1 && typeof localStorage.getItem("userSessionData") != 'undefined' && localStorage.getItem("userSessionData") != null){ localStorage.removeItem("userSessionData"); } if(typeof checkLocalStorage!= 'undefined' && checkLocalStorage==true && document.cookie.indexOf("CakeCookie[isLogin]")==-1 && typeof localStorage.getItem("ufSessionData") != 'undefined' && localStorage.getItem("ufSessionData") != null){ localStorage.removeItem("ufSessionData"); } if(typeof checkLocalStorage!= 'undefined' && checkLocalStorage==true && document.cookie.indexOf("CakeCookie[isLogin]")==-1 && typeof localStorage.getItem("CConnectoVariableDesk") != 'undefined' && localStorage.getItem("CConnectoVariableDesk") != null){ localStorage.removeItem("CConnectoVariableDesk"); } } //Remove LocalStorage Cached Data for User Change board Grade function removeLocalStorageUserSessionKey(){ var checkLocalStorage = isBrowserSupportLocalStorage(); if(typeof checkLocalStorage!= 'undefined' && checkLocalStorage==true && typeof localStorage.getItem("userSessionData") != 'undefined' && localStorage.getItem("userSessionData") != null){ localStorage.removeItem("userSessionData"); } if(typeof checkLocalStorage!= 'undefined' && checkLocalStorage==true && typeof localStorage.getItem("ufSessionData") != 'undefined' && localStorage.getItem("ufSessionData") != null){ localStorage.removeItem("ufSessionData"); } if(typeof checkLocalStorage!= 'undefined' && checkLocalStorage==true && typeof localStorage.getItem("CConnectoVariableDesk") != 'undefined' && localStorage.getItem("CConnectoVariableDesk") != null){ localStorage.removeItem("CConnectoVariableDesk"); } //LcJeePlusDetail_ for(var i = 0; i < localStorage.length; i++){ if (localStorage.key(i).indexOf('LcJeePlusDetail_') >= 0) { localStorage.removeItem(localStorage.key(i)); } } } function isBrowserSupportLocalStorage(){ if(typeof window.localStorage!= 'undefined' && "localStorage" in window) { return true ; } else{ return false; } } function googleAnalyticCode(gaVariables) { (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-6131270-3','auto'); var dimension5 = 0; if(readCookie('CakeCookie[is_register]')){ dimension5 = 1; } if(gaVariables.isLogin==1) { ga('set', '&uid', gaVariables.userId); ga('set', 'dimension1', (gaVariables.isPaid==1) ? 'Paid' : 'Free'); ga('set', 'dimension2', gaVariables.curriculum); ga('set', 'dimension3', gaVariables.class); ga('set', 'dimension4', '1'); ga('set', 'dimension5', dimension5); }else{ ga('set', 'dimension4', '0'); ga('set', 'dimension5', dimension5); } ga('send','pageview'); }